home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1996 February / macformat-034.iso / mac / Shareware City / Developers / styled-text-xfcn / Read⁄Write Styled SC / READ ME [STYLED] next >
Encoding:
Text File  |  1995-11-21  |  7.4 KB  |  101 lines  |  [ttro/ttxt]

  1.              ReadStyled
  2.                       &
  3.              WriteStyled
  4.  
  5. Externals for SuperCard®
  6. Copyright @ 11/95 by Tracy L. Hinshaw.  All rights reserved.
  7.  
  8. What They Are:
  9. ReadStyled and WriteStyled are XFCN's for SuperCard® that allow you to exchange styled text between external files and your SuperCard® project. ReadStyled and WriteStyled are compatible with the SimpleText file format so that they may be used in conjunction with any styled-text editor.
  10.  
  11. ReadStyled and WriteStyled XFCN's are shareware.  If you use these externals in your personal/shareware/freeware projects, please send $15.00 U.S.  (or equivalent international currency) to:
  12.  
  13. Tracy L. Hinshaw
  14. Parnassien Language Software
  15. P.O. Box 142
  16. Kellogg, IA  50135  U.S.A.
  17.  
  18. If you intend to include these externals in shareware/freeware applications or in any other commercial product, please contact the author for licensing/distribution information and approval at the above address or by email at:  
  19.  
  20.                               parnassien@netins.net
  21.  
  22. Syntax:
  23.  
  24. ReadStyled:        
  25.              
  26.                 get ReadStyled(Filename,fieldID,CardID,WindowID,IsCardField)        
  27.  
  28.             •filename                         =     complete path to import file
  29.             •FieldID                             =        the SHORT ID of the field to hold the text
  30.             •CardID                                    =        the SHORT ID of the card to hold the field
  31.             •WindowID                            =        the SHORT ID of the window to hold the card
  32.             •IsCardField                =        [TRUE/FALSE] is the fld a card field?
  33.  
  34. Return Values:  ReadStyled returns a two-lined result:
  35.  
  36.          •first line:
  37.                  0            =    no errors within the XFCN
  38.                 -1            =    invalid path — no such field | card | window found
  39.                 -2            =    file empty; nothing read
  40.                 -3            =    invalid parameter count
  41.  
  42.      •second line:
  43.                  Copyright information
  44.  
  45.                                                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  46. WriteStyled:        
  47.              
  48.                 get WriteStyled(Filename,fieldID,CardID,WindowID,IsCardField,[Creator])        
  49.  
  50.             •filename                         =     complete path to export file
  51.             •FieldID                             =        the SHORT ID of the field holding the text
  52.             •CardID                                    =        the SHORT ID of the card holding the field
  53.             •WindowID                            =        the SHORT ID of the window holding the card
  54.             •IsCardField                =        [TRUE/FALSE] is the fld a card field?
  55.       •Creator                                =        [optional]  The 4 character creator type of the new file.
  56.                                                                                         (default is "ttxt".  My favourite?  "TBB6" = Tom Bender's
  57.                                                                                         Tex-Edit Plus.)
  58.  
  59. Return Values:  WriteStyled returns a two-lined result:
  60.  
  61.          •first line:
  62.                  0            =    no errors within the XFCN
  63.                 -1            =    invalid path — no such field | card | window found
  64.                 -2            =    file empty; nothing written
  65.                 -3            =    invalid parameter count
  66.  
  67.      •second line:
  68.                  Copyright information
  69.                                                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  70.  
  71. What They Do and What They Don't Do
  72. •Card fields; Background fields; hidden fields... ReadStyled and WriteStyled XFCN's work with both card and background fields.  The "locktext" property of the target fields need not be set to false for ReadStyled and WriteStyled to work - they'll take care of that.  Fields do need to be visible however and they do need to be on the current card.  ReadStyled and WriteStyled cannot work with fields that have been hidden or that reside on different cards or in different windows.
  73.  
  74. •File Types... ReadStyled and WriteStyled are compatible only with files that use 'styl' resources to hold style information (such as those created by SimpleText or Tex-Edit Plus).  Many commercial word processors treat styled text in their own way (i.e.:  Microsoft Word) and consequently, files created by these applications will not retain style attributes when processed by ReadStyled.  Of course, ReadStyled is always compatible with files created by WriteStyled.
  75.  
  76. •CardID, FieldID, WindowID...  It is necessary that you send "the short ID" to the XFCN.  If you send "the id" or "the long id" the XFCN's will fail.  (See the demo scripts if you're unsure as to how to indicate this in your scripts).
  77.  
  78. •Large files;  files with several styles...  Unfortunately, ReadStyled and WriteStyled can currently only handle files containing up to 32000 characters.  The larger the files, of course, the longer it will take for ReadStyled and WriteStyled to process their style information and the more memory they will require to operated comfortably.  ReadStyled and WriteStyled were created and tested primarily on a Macintosh LC with 4 MB RAM (yes, people really do still use them).  Large files or files containing complicated or an unusually large number of style "runs" have been known to take as long as 25 seconds to process.  As is the case with every program, the more memory installed and the faster your machine, the more pleasant your experience with ReadStyled and WriteStyled will be.
  79.  
  80. •The LockScreen...  ReadStyled and WriteStyled don't "lock the screen" as they work.  As a result, you may see a "flash" or two as they replace or read the text in your target field.  This can be distracting but is easily treated by simply using "lock screen" - "unlock screen" before and after the XFCN calls.
  81.  
  82. •Cursors...  ReadStyled and WriteStyled don't choose a cursor state when running.  This was done so as not to interfere with any customized cursors the user may prefer. You may want to at least set the cursor to "watch" before the XFCN call - especially if using one of the large files described above.
  83.  
  84. •Global Variables... ReadStyled and WriteStyled work only with fields and cannot store styled information in global variables.
  85.  
  86. •Palettes; floating windows and mutiple projects... ReadStyled and WriteStyled will work with palette style windows if the current project owns the top-most window.  Example:  If the only opened window of your project is a palette AND you have another palette window opened from a second project (i.e.:  the colour palette from the Runtime Editor) - the XFCN's WILL NOT WORK because in this case, the Runtime Editor owns the topmost window.  This will probably never come up but if it does, just make sure that your project owns the "top window."
  87.  
  88. •File Creators... WriteStyled allows you to specify a file creator for new files.  This is the last parameter and should be the correct four-character creator type (i.e.:  Tex-Edit Plus = "TBB6").  The default is SimpleText ("ttxt").  Note that this is also the creator type for SimpleText's earlier incarnation "TeachText."  If TeachText opens files created by WriteStyled, style information will not be displayed.
  89.  
  90. •Clipboard...  ReadStyled and WriteStyled use the same memory as the clipboard.  Don't run the XFCN's if you have anything important in the clipboard because ReadStyled and WriteStyled both clear it before executing.
  91.  
  92. Mumbo-Jumbo and Other Legal Stuff
  93.  
  94. The ReadStyled and WriteStyled package and each of its components are provided AS IS. No guarantee or warranty, express or implied, is made on the operation of this product, or its suitability for any task. In no event shall the programmer, Tracy L. Hinshaw, or his suppliers  be liable for any damages whatsoever (including, without limitation, damage for loss of profit, business interruption, loss of information, or other pecuniary loss) arising out of the use, misuse of or inability to use this product.  
  95. The author, Tracy L. Hinshaw, disclaims all other warranties either expressed or implied, including, but not limited to implied warranties of merchantability and fitness for a particular purpose, with respect to the product.
  96.  
  97.  
  98. Copyright © 1995, Tracy L. Hinshaw,  Kellogg, Iowa
  99.  
  100. Please support shareware and help keep this out-of-work French Teacher off the streets!
  101.